﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _084.Identity框架
{
    public class MyDbContextDesignFac : IDesignTimeDbContextFactory<MyDbContext>
    {
        // 开发时运行 正式项目运行的时候不会用
        public MyDbContext CreateDbContext(string[] args)
        {
            DbContextOptionsBuilder<MyDbContext> builder = new DbContextOptionsBuilder<MyDbContext>();
            string? connStr = "Server=10.34.10.12,1433;Database=fanzhineng;uid=fzn;Password=Ub6PjWV5r8J0&X!b;";
            builder.UseSqlServer(connStr);
            return new MyDbContext(builder.Options);

        }
    }
}
